package com.ghsc.ghxc.jsb.ui.message.view

import androidx.appcompat.app.AppCompatActivity
import com.ghsc.ghxc.jsb.R
import com.ghsc.ghxc.jsb.ui.message.fragment.NewRobRedFragment
import com.lxj.xpopup.core.CenterPopupView
import com.netease.yunxin.kit.chatkit.ui.model.ChatMessageBean

/**
 * 项目：JingShortVideo
 * 包名：com.bbl.jyShortVideo.ui.chat.view
 * 类名：NewGroupPopView
 * 创建时间：2022/10/10 11:35
 * 创建人 @author： xiaolin
 * 描述 ：Todo...抢红包
 */
//抢红包新
class NewRobRedPopView  (context: AppCompatActivity, bean: ChatMessageBean) : CenterPopupView(context) {

    override fun getImplLayoutId() = R.layout.pw_rob_red
    private val mContext = context
    private val bean: ChatMessageBean  =bean



    override fun onCreate() {
        super.onCreate()
        val activity = mContext as AppCompatActivity
        val beginTransaction = activity.supportFragmentManager.beginTransaction()
        val fragment = NewRobRedFragment.newInstance(bean)
        beginTransaction.add(R.id.flContainer,fragment)
        beginTransaction.commit()
        fragment.setOnDismissListener {
            this@NewRobRedPopView.dismiss()
        }

    }
    override fun getInternalFragmentNames(): MutableList<String> {
        val list = mutableListOf<String>()
        list.add(NewRobRedFragment::class.java.simpleName)
        return list
    }

    override fun getMaxWidth() = 0
}

